package com.css.crm.dao.impl;

import java.util.List;

import org.apache.ibatis.session.SqlSession;

import com.css.crm.dao.RegisterKeyDao;
import com.css.crm.vo.RegisterKeyVo;

/**
 * Implementation for RegisterKeyDao
 * 
 * @author ais
 */
public class RegisterKeyDaoImpl extends BaseDaoImpl implements RegisterKeyDao {

	public RegisterKeyDaoImpl() {
	}

	/* (non-Javadoc)
	 * @see com.css.crm.dao.RegisterKeyDao#getRegisterKeyById(java.lang.Long)
	 */
	@Override
	public RegisterKeyVo getRegisterKeyById(Long id) {

		SqlSession session = getMyBatisSession();
		return session.selectOne("registerKey.getRegisterKeyById", id);
	}

	/* (non-Javadoc)
	 * @see com.css.crm.dao.RegisterKeyDao#deleteRegisterKeyById(java.lang.Long)
	 */
	@Override
	public int deleteRegisterKeyById(Long id) {

		SqlSession session = getMyBatisSession();
		return session.delete("registerKey.deleteRegisterKeyById", id);
	}

	/* (non-Javadoc)
	 * @see com.css.crm.dao.RegisterKeyDao#insertRegisterKey(com.css.crm.vo.RegisterKeyVo)
	 */
	@Override
	public int insertRegisterKey(RegisterKeyVo vo) {

		SqlSession session = getMyBatisSession();
		return session.insert("registerKey.insertRegisterKey", vo);
	}

	/* (non-Javadoc)
	 * @see com.css.crm.dao.RegisterKeyDao#updateRegisterKey(com.css.crm.vo.RegisterKeyVo)
	 */
	@Override
	public int updateRegisterKey(RegisterKeyVo vo) {

		SqlSession session = getMyBatisSession();
		return session.update("registerKey.updateRegisterKey", vo);
	}

	/* (non-Javadoc)
	 * @see com.css.crm.dao.RegisterKeyDao#queryRegisterKey(com.css.crm.vo.RegisterKeyVo)
	 */
	@Override
	public List<RegisterKeyVo> queryRegisterKey(RegisterKeyVo vo) {

		SqlSession session = getMyBatisSession();
		return session.selectList("registerKey.queryRegisterKey", vo);
	}

}
